<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2017 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Author: pl125 <xskjs888@163.com>
// +----------------------------------------------------------------------

namespace api\index\controller;

use app\portal\model\PortalCategoryPostModel;
use cmf\controller\RestBaseController;
use think\Db;

class IndexController extends RestBaseController
{
    public function index()
    {

        $this->success('请求成功!', ['test'=>'test']);
    }
    public function get_list(){
        $model=new PortalCategoryPostModel();
        $count = Db::name('portal_category_post')->count();
        $limit= input('limit');
        $page= input('page');
        $tol=($page-1)*$limit+1;
        $list = $model->where("id",">=","$tol")->limit("$limit")->select();
        //返回数据
        return ["code"=>"0","msg"=>"","count"=>$count,"data"=>$list];
    }
}
